package RLK_SQLCON;

public class Example {
    public List<Integer> getActiveIDs() throws SQLException {
        Connection con = DriverManager.getConnection("http://");
        Statement statement = con.createStatement();
        ResultSet rs = statement.executeQuery("SELECT * FROM table");

        final List<Integer> result = new ArrayList<Integer>();
        while (rs.next()) {
            if (rs.getBoolean("active")) {
                result.add(rs.getInt("id"));
            }
        }
        return result;
    }
}
